﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WinFormsApp1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        { 
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                var path = System.IO.Path.GetFullPath(openFileDialog1.FileName);
                textBox1.Text = path;
                //System.IO.Path.GetFullPath(openFileDialog1.FileName); //绝对路径
                //System.IO.Path.GetExtension(openFileDialog1.FileName); //文件扩展名
                //System.IO.Path.GetFileNameWithoutExtension(openFileDialog1.FileName); //文件名没有扩展名
                //System.IO.Path.GetFileName(openFileDialog1.FileName); //得到文件
                //System.IO.Path.GetDirectoryName(openFileDialog1.FileName); //得到路径 


                //var resultJson = ClassLibrary1.Redwine.redwine(path);
                //textBox2.Text = resultJson;
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            var resultJson = ClassLibrary1.Redwine.redwine(textBox1.Text.Trim());
            textBox2.Text = resultJson;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            var resultJson = ClassLibrary1.Currency.currency(textBox1.Text.Trim());
            textBox2.Text = resultJson;
        }

        private void button4_Click(object sender, EventArgs e)
        {
            var resultJson = ClassLibrary1.AdvancedGeneral.advancedGeneral(textBox1.Text.Trim());
            textBox2.Text = resultJson;
        }
    }
}
